\(\int (f+g x)^2 (A+B \log (e (\frac {a+b x}{c+d x})^n))^2 \, dx\) [68]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [F]
   Sympy [F(-1)]
   Maxima [B] (verification not implemented)
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 32, antiderivative size = 565 \[ \int (f+g x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=\frac {B^2 (b c-a d)^2 g^2 n^2 x}{3 b^2 d^2}-\frac {2 B (b c-a d) g (3 b d f-2 b c g-a d g) n (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 b^3 d^2}-\frac {B (b c-a d) g^2 n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 b d^3}-\frac {(b f-a g)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 b^3 g}+\frac {(f+g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g}+\frac {2 B (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log \left (\frac {b c-a d}{b (c+d x)}\right )}{3 b^3 d^3}+\frac {B^2 (b c-a d)^3 g^2 n^2 \log \left (\frac {a+b x}{c+d x}\right )}{3 b^3 d^3}+\frac {B^2 (b c-a d)^3 g^2 n^2 \log (c+d x)}{3 b^3 d^3}+\frac {2 B^2 (b c-a d)^2 g (3 b d f-2 b c g-a d g) n^2 \log (c+d x)}{3 b^3 d^3}+\frac {2 B^2 (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n^2 \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{b (c+d x)}\right )}{3 b^3 d^3} \]

[Out]

1/3*B^2*(-a*d+b*c)^2*g^2*n^2*x/b^2/d^2-2/3*B*(-a*d+b*c)*g*(-a*d*g-2*b*c*g+3*b*d*f)*n*(b*x+a)*(A+B*ln(e*((b*x+a
)/(d*x+c))^n))/b^3/d^2-1/3*B*(-a*d+b*c)*g^2*n*(d*x+c)^2*(A+B*ln(e*((b*x+a)/(d*x+c))^n))/b/d^3-1/3*(-a*g+b*f)^3
*(A+B*ln(e*((b*x+a)/(d*x+c))^n))^2/b^3/g+1/3*(g*x+f)^3*(A+B*ln(e*((b*x+a)/(d*x+c))^n))^2/g+2/3*B*(-a*d+b*c)*(a
^2*d^2*g^2-a*b*d*g*(-c*g+3*d*f)+b^2*(c^2*g^2-3*c*d*f*g+3*d^2*f^2))*n*(A+B*ln(e*((b*x+a)/(d*x+c))^n))*ln((-a*d+
b*c)/b/(d*x+c))/b^3/d^3+1/3*B^2*(-a*d+b*c)^3*g^2*n^2*ln((b*x+a)/(d*x+c))/b^3/d^3+1/3*B^2*(-a*d+b*c)^3*g^2*n^2*
ln(d*x+c)/b^3/d^3+2/3*B^2*(-a*d+b*c)^2*g*(-a*d*g-2*b*c*g+3*b*d*f)*n^2*ln(d*x+c)/b^3/d^3+2/3*B^2*(-a*d+b*c)*(a^
2*d^2*g^2-a*b*d*g*(-c*g+3*d*f)+b^2*(c^2*g^2-3*c*d*f*g+3*d^2*f^2))*n^2*polylog(2,d*(b*x+a)/b/(d*x+c))/b^3/d^3

Rubi [A] (verified)

Time = 0.74 (sec) , antiderivative size = 565, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {2553, 2398, 2404, 2338, 2356, 46, 2351, 31, 2354, 2438} \[ \int (f+g x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=\frac {2 B n (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (c^2 g^2-3 c d f g+3 d^2 f^2\right )\right ) \log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{3 b^3 d^3}+\frac {2 B^2 n^2 (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (c^2 g^2-3 c d f g+3 d^2 f^2\right )\right ) \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{b (c+d x)}\right )}{3 b^3 d^3}-\frac {2 B g n (a+b x) (b c-a d) (-a d g-2 b c g+3 b d f) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{3 b^3 d^2}-\frac {(b f-a g)^3 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{3 b^3 g}-\frac {B g^2 n (c+d x)^2 (b c-a d) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{3 b d^3}+\frac {(f+g x)^3 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{3 g}+\frac {2 B^2 g n^2 (b c-a d)^2 \log (c+d x) (-a d g-2 b c g+3 b d f)}{3 b^3 d^3}+\frac {B^2 g^2 n^2 (b c-a d)^3 \log \left (\frac {a+b x}{c+d x}\right )}{3 b^3 d^3}+\frac {B^2 g^2 n^2 (b c-a d)^3 \log (c+d x)}{3 b^3 d^3}+\frac {B^2 g^2 n^2 x (b c-a d)^2}{3 b^2 d^2} \]

[In]

Int[(f + g*x)^2*(A + B*Log[e*((a + b*x)/(c + d*x))^n])^2,x]

[Out]

(B^2*(b*c - a*d)^2*g^2*n^2*x)/(3*b^2*d^2) - (2*B*(b*c - a*d)*g*(3*b*d*f - 2*b*c*g - a*d*g)*n*(a + b*x)*(A + B*
Log[e*((a + b*x)/(c + d*x))^n]))/(3*b^3*d^2) - (B*(b*c - a*d)*g^2*n*(c + d*x)^2*(A + B*Log[e*((a + b*x)/(c + d
*x))^n]))/(3*b*d^3) - ((b*f - a*g)^3*(A + B*Log[e*((a + b*x)/(c + d*x))^n])^2)/(3*b^3*g) + ((f + g*x)^3*(A + B
*Log[e*((a + b*x)/(c + d*x))^n])^2)/(3*g) + (2*B*(b*c - a*d)*(a^2*d^2*g^2 - a*b*d*g*(3*d*f - c*g) + b^2*(3*d^2
*f^2 - 3*c*d*f*g + c^2*g^2))*n*(A + B*Log[e*((a + b*x)/(c + d*x))^n])*Log[(b*c - a*d)/(b*(c + d*x))])/(3*b^3*d
^3) + (B^2*(b*c - a*d)^3*g^2*n^2*Log[(a + b*x)/(c + d*x)])/(3*b^3*d^3) + (B^2*(b*c - a*d)^3*g^2*n^2*Log[c + d*
x])/(3*b^3*d^3) + (2*B^2*(b*c - a*d)^2*g*(3*b*d*f - 2*b*c*g - a*d*g)*n^2*Log[c + d*x])/(3*b^3*d^3) + (2*B^2*(b
*c - a*d)*(a^2*d^2*g^2 - a*b*d*g*(3*d*f - c*g) + b^2*(3*d^2*f^2 - 3*c*d*f*g + c^2*g^2))*n^2*PolyLog[2, (d*(a +
 b*x))/(b*(c + d*x))])/(3*b^3*d^3)

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2351

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_) + (e_.)*(x_)^(r_.))^(q_), x_Symbol] :> Simp[x*(d + e*x^r)^(q +
 1)*((a + b*Log[c*x^n])/d), x] - Dist[b*(n/d), Int[(d + e*x^r)^(q + 1), x], x] /; FreeQ[{a, b, c, d, e, n, q,
r}, x] && EqQ[r*(q + 1) + 1, 0]

Rule 2354

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[Log[1 + e*(x/d)]*((a +
b*Log[c*x^n])^p/e), x] - Dist[b*n*(p/e), Int[Log[1 + e*(x/d)]*((a + b*Log[c*x^n])^(p - 1)/x), x], x] /; FreeQ[
{a, b, c, d, e, n}, x] && IGtQ[p, 0]

Rule 2356

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Simp[(d + e*x)^(q + 1)
*((a + b*Log[c*x^n])^p/(e*(q + 1))), x] - Dist[b*n*(p/(e*(q + 1))), Int[((d + e*x)^(q + 1)*(a + b*Log[c*x^n])^
(p - 1))/x, x], x] /; FreeQ[{a, b, c, d, e, n, p, q}, x] && GtQ[p, 0] && NeQ[q, -1] && (EqQ[p, 1] || (Integers
Q[2*p, 2*q] &&  !IGtQ[q, 0]) || (EqQ[p, 2] && NeQ[q, 1]))

Rule 2398

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_) + (e_.)*(x_))^(q_)*((f_) + (g_.)*(x_))^(m_.), x_Symbol]
:> Simp[(f + g*x)^(m + 1)*(d + e*x)^(q + 1)*((a + b*Log[c*x^n])^p/((q + 1)*(e*f - d*g))), x] - Dist[b*n*(p/((q
 + 1)*(e*f - d*g))), Int[(f + g*x)^(m + 1)*(d + e*x)^(q + 1)*((a + b*Log[c*x^n])^(p - 1)/x), x], x] /; FreeQ[{
a, b, c, d, e, f, g, m, n, q}, x] && NeQ[e*f - d*g, 0] && EqQ[m + q + 2, 0] && IGtQ[p, 0] && LtQ[q, -1]

Rule 2404

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[(a + b*Log[c*x^
n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, n}, x] && RationalFunctionQ[RFx, x] && IGtQ[p, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 2553

Int[((A_.) + Log[(e_.)*(((a_.) + (b_.)*(x_))/((c_.) + (d_.)*(x_)))^(n_.)]*(B_.))^(p_.)*((f_.) + (g_.)*(x_))^(m
_.), x_Symbol] :> Dist[b*c - a*d, Subst[Int[(b*f - a*g - (d*f - c*g)*x)^m*((A + B*Log[e*x^n])^p/(b - d*x)^(m +
 2)), x], x, (a + b*x)/(c + d*x)], x] /; FreeQ[{a, b, c, d, e, f, g, A, B, n}, x] && NeQ[b*c - a*d, 0] && Inte
gerQ[m] && IGtQ[p, 0]

Rubi steps \begin{align*} \text {integral}& = (b c-a d) \text {Subst}\left (\int \frac {(b f-a g-(d f-c g) x)^2 \left (A+B \log \left (e x^n\right )\right )^2}{(b-d x)^4} \, dx,x,\frac {a+b x}{c+d x}\right ) \\ & = \frac {(f+g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g}-\frac {(2 B n) \text {Subst}\left (\int \frac {(b f-a g+(-d f+c g) x)^3 \left (A+B \log \left (e x^n\right )\right )}{x (b-d x)^3} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 g} \\ & = \frac {(f+g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g}-\frac {(2 B n) \text {Subst}\left (\int \left (\frac {(b f-a g)^3 \left (A+B \log \left (e x^n\right )\right )}{b^3 x}+\frac {(b c-a d)^3 g^3 \left (A+B \log \left (e x^n\right )\right )}{b d^2 (b-d x)^3}+\frac {(b c-a d)^2 g^2 (3 b d f-2 b c g-a d g) \left (A+B \log \left (e x^n\right )\right )}{b^2 d^2 (b-d x)^2}+\frac {(b c-a d) g \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) \left (A+B \log \left (e x^n\right )\right )}{b^3 d^2 (b-d x)}\right ) \, dx,x,\frac {a+b x}{c+d x}\right )}{3 g} \\ & = \frac {(f+g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g}-\frac {\left (2 B (b c-a d)^3 g^2 n\right ) \text {Subst}\left (\int \frac {A+B \log \left (e x^n\right )}{(b-d x)^3} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 b d^2}-\frac {\left (2 B (b f-a g)^3 n\right ) \text {Subst}\left (\int \frac {A+B \log \left (e x^n\right )}{x} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 b^3 g}-\frac {\left (2 B (b c-a d)^2 g (3 b d f-2 b c g-a d g) n\right ) \text {Subst}\left (\int \frac {A+B \log \left (e x^n\right )}{(b-d x)^2} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 b^2 d^2}-\frac {\left (2 B (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n\right ) \text {Subst}\left (\int \frac {A+B \log \left (e x^n\right )}{b-d x} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 b^3 d^2} \\ & = -\frac {2 B (b c-a d) g (3 b d f-2 b c g-a d g) n (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 b^3 d^2}-\frac {B (b c-a d) g^2 n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 b d^3}-\frac {(b f-a g)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 b^3 g}+\frac {(f+g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g}+\frac {2 B (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log \left (\frac {b c-a d}{b (c+d x)}\right )}{3 b^3 d^3}+\frac {\left (B^2 (b c-a d)^3 g^2 n^2\right ) \text {Subst}\left (\int \frac {1}{x (b-d x)^2} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 b d^3}+\frac {\left (2 B^2 (b c-a d)^2 g (3 b d f-2 b c g-a d g) n^2\right ) \text {Subst}\left (\int \frac {1}{b-d x} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 b^3 d^2}-\frac {\left (2 B^2 (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n^2\right ) \text {Subst}\left (\int \frac {\log \left (1-\frac {d x}{b}\right )}{x} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 b^3 d^3} \\ & = -\frac {2 B (b c-a d) g (3 b d f-2 b c g-a d g) n (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 b^3 d^2}-\frac {B (b c-a d) g^2 n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 b d^3}-\frac {(b f-a g)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 b^3 g}+\frac {(f+g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g}+\frac {2 B (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log \left (\frac {b c-a d}{b (c+d x)}\right )}{3 b^3 d^3}+\frac {2 B^2 (b c-a d)^2 g (3 b d f-2 b c g-a d g) n^2 \log (c+d x)}{3 b^3 d^3}+\frac {2 B^2 (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n^2 \text {Li}_2\left (\frac {d (a+b x)}{b (c+d x)}\right )}{3 b^3 d^3}+\frac {\left (B^2 (b c-a d)^3 g^2 n^2\right ) \text {Subst}\left (\int \left (\frac {1}{b^2 x}+\frac {d}{b (b-d x)^2}+\frac {d}{b^2 (b-d x)}\right ) \, dx,x,\frac {a+b x}{c+d x}\right )}{3 b d^3} \\ & = \frac {B^2 (b c-a d)^2 g^2 n^2 x}{3 b^2 d^2}-\frac {2 B (b c-a d) g (3 b d f-2 b c g-a d g) n (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 b^3 d^2}-\frac {B (b c-a d) g^2 n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 b d^3}-\frac {(b f-a g)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 b^3 g}+\frac {(f+g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g}+\frac {2 B (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log \left (\frac {b c-a d}{b (c+d x)}\right )}{3 b^3 d^3}+\frac {B^2 (b c-a d)^3 g^2 n^2 \log \left (\frac {a+b x}{c+d x}\right )}{3 b^3 d^3}+\frac {B^2 (b c-a d)^3 g^2 n^2 \log (c+d x)}{3 b^3 d^3}+\frac {2 B^2 (b c-a d)^2 g (3 b d f-2 b c g-a d g) n^2 \log (c+d x)}{3 b^3 d^3}+\frac {2 B^2 (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n^2 \text {Li}_2\left (\frac {d (a+b x)}{b (c+d x)}\right )}{3 b^3 d^3} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.36 (sec) , antiderivative size = 506, normalized size of antiderivative = 0.90 \[ \int (f+g x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=\frac {(f+g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2-\frac {B n \left (2 A b d (b c-a d) g^2 (3 b d f-b c g-a d g) x+2 B d (b c-a d) g^2 (3 b d f-b c g-a d g) (a+b x) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+b^2 d^2 (b c-a d) g^3 x^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+2 d^3 (b f-a g)^3 \log (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+2 B (b c-a d)^2 g^2 (-3 b d f+b c g+a d g) n \log (c+d x)-2 b^3 (d f-c g)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log (c+d x)-B (b c-a d) g^3 n \left (a^2 d^2 \log (a+b x)-b \left (d (-b c+a d) x+b c^2 \log (c+d x)\right )\right )-B d^3 (b f-a g)^3 n \left (\log (a+b x) \left (\log (a+b x)-2 \log \left (\frac {b (c+d x)}{b c-a d}\right )\right )-2 \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{-b c+a d}\right )\right )+b^3 B (d f-c g)^3 n \left (\left (2 \log \left (\frac {d (a+b x)}{-b c+a d}\right )-\log (c+d x)\right ) \log (c+d x)+2 \operatorname {PolyLog}\left (2,\frac {b (c+d x)}{b c-a d}\right )\right )\right )}{b^3 d^3}}{3 g} \]

[In]

Integrate[(f + g*x)^2*(A + B*Log[e*((a + b*x)/(c + d*x))^n])^2,x]

[Out]

((f + g*x)^3*(A + B*Log[e*((a + b*x)/(c + d*x))^n])^2 - (B*n*(2*A*b*d*(b*c - a*d)*g^2*(3*b*d*f - b*c*g - a*d*g
)*x + 2*B*d*(b*c - a*d)*g^2*(3*b*d*f - b*c*g - a*d*g)*(a + b*x)*Log[e*((a + b*x)/(c + d*x))^n] + b^2*d^2*(b*c
- a*d)*g^3*x^2*(A + B*Log[e*((a + b*x)/(c + d*x))^n]) + 2*d^3*(b*f - a*g)^3*Log[a + b*x]*(A + B*Log[e*((a + b*
x)/(c + d*x))^n]) + 2*B*(b*c - a*d)^2*g^2*(-3*b*d*f + b*c*g + a*d*g)*n*Log[c + d*x] - 2*b^3*(d*f - c*g)^3*(A +
 B*Log[e*((a + b*x)/(c + d*x))^n])*Log[c + d*x] - B*(b*c - a*d)*g^3*n*(a^2*d^2*Log[a + b*x] - b*(d*(-(b*c) + a
*d)*x + b*c^2*Log[c + d*x])) - B*d^3*(b*f - a*g)^3*n*(Log[a + b*x]*(Log[a + b*x] - 2*Log[(b*(c + d*x))/(b*c -
a*d)]) - 2*PolyLog[2, (d*(a + b*x))/(-(b*c) + a*d)]) + b^3*B*(d*f - c*g)^3*n*((2*Log[(d*(a + b*x))/(-(b*c) + a
*d)] - Log[c + d*x])*Log[c + d*x] + 2*PolyLog[2, (b*(c + d*x))/(b*c - a*d)])))/(b^3*d^3))/(3*g)

Maple [F]

\[\int \left (g x +f \right )^{2} {\left (A +B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )\right )}^{2}d x\]

[In]

int((g*x+f)^2*(A+B*ln(e*((b*x+a)/(d*x+c))^n))^2,x)

[Out]

int((g*x+f)^2*(A+B*ln(e*((b*x+a)/(d*x+c))^n))^2,x)

Fricas [F]

\[ \int (f+g x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=\int { {\left (g x + f\right )}^{2} {\left (B \log \left (e \left (\frac {b x + a}{d x + c}\right )^{n}\right ) + A\right )}^{2} \,d x } \]

[In]

integrate((g*x+f)^2*(A+B*log(e*((b*x+a)/(d*x+c))^n))^2,x, algorithm="fricas")

[Out]

integral(A^2*g^2*x^2 + 2*A^2*f*g*x + A^2*f^2 + (B^2*g^2*x^2 + 2*B^2*f*g*x + B^2*f^2)*log(e*((b*x + a)/(d*x + c
))^n)^2 + 2*(A*B*g^2*x^2 + 2*A*B*f*g*x + A*B*f^2)*log(e*((b*x + a)/(d*x + c))^n), x)

Sympy [F(-1)]

Timed out. \[ \int (f+g x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=\text {Timed out} \]

[In]

integrate((g*x+f)**2*(A+B*ln(e*((b*x+a)/(d*x+c))**n))**2,x)

[Out]

Timed out

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1659 vs. \(2 (544) = 1088\).

Time = 0.69 (sec) , antiderivative size = 1659, normalized size of antiderivative = 2.94 \[ \int (f+g x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=\text {Too large to display} \]

[In]

integrate((g*x+f)^2*(A+B*log(e*((b*x+a)/(d*x+c))^n))^2,x, algorithm="maxima")

[Out]

2/3*A*B*g^2*x^3*log(e*(b*x/(d*x + c) + a/(d*x + c))^n) + 1/3*A^2*g^2*x^3 + 2*A*B*f*g*x^2*log(e*(b*x/(d*x + c)
+ a/(d*x + c))^n) + A^2*f*g*x^2 + 1/3*A*B*g^2*n*(2*a^3*log(b*x + a)/b^3 - 2*c^3*log(d*x + c)/d^3 - ((b^2*c*d -
 a*b*d^2)*x^2 - 2*(b^2*c^2 - a^2*d^2)*x)/(b^2*d^2)) - 2*A*B*f*g*n*(a^2*log(b*x + a)/b^2 - c^2*log(d*x + c)/d^2
 + (b*c - a*d)*x/(b*d)) + 2*A*B*f^2*n*(a*log(b*x + a)/b - c*log(d*x + c)/d) + 2*A*B*f^2*x*log(e*(b*x/(d*x + c)
 + a/(d*x + c))^n) + A^2*f^2*x + 1/3*(2*a^2*c*d^2*g^2*n^2 - (6*c*d^2*f*g*n^2 - c^2*d*g^2*n^2)*a*b - (6*c*d^2*f
^2*n*log(e) + (3*g^2*n^2 + 2*g^2*n*log(e))*c^3 - 6*(f*g*n^2 + f*g*n*log(e))*c^2*d)*b^2)*B^2*log(d*x + c)/(b^2*
d^3) + 2/3*(3*a*b^2*d^3*f^2*n^2 - 3*a^2*b*d^3*f*g*n^2 + a^3*d^3*g^2*n^2 - (3*c*d^2*f^2*n^2 - 3*c^2*d*f*g*n^2 +
 c^3*g^2*n^2)*b^3)*(log(b*x + a)*log((b*d*x + a*d)/(b*c - a*d) + 1) + dilog(-(b*d*x + a*d)/(b*c - a*d)))*B^2/(
b^3*d^3) + 1/3*(B^2*b^3*d^3*g^2*x^3*log(e)^2 + 2*(3*c*d^2*f^2*n^2 - 3*c^2*d*f*g*n^2 + c^3*g^2*n^2)*B^2*b^3*log
(b*x + a)*log(d*x + c) - (3*c*d^2*f^2*n^2 - 3*c^2*d*f*g*n^2 + c^3*g^2*n^2)*B^2*b^3*log(d*x + c)^2 + (a*b^2*d^3
*g^2*n*log(e) - (c*d^2*g^2*n*log(e) - 3*d^3*f*g*log(e)^2)*b^3)*B^2*x^2 - (3*a*b^2*d^3*f^2*n^2 - 3*a^2*b*d^3*f*
g*n^2 + a^3*d^3*g^2*n^2)*B^2*log(b*x + a)^2 + ((g^2*n^2 - 2*g^2*n*log(e))*a^2*b*d^3 - 2*(c*d^2*g^2*n^2 - 3*d^3
*f*g*n*log(e))*a*b^2 - (6*c*d^2*f*g*n*log(e) - 3*d^3*f^2*log(e)^2 - (g^2*n^2 + 2*g^2*n*log(e))*c^2*d)*b^3)*B^2
*x - ((3*g^2*n^2 - 2*g^2*n*log(e))*a^3*d^3 - (c*d^2*g^2*n^2 + 6*(f*g*n^2 - f*g*n*log(e))*d^3)*a^2*b + 2*(3*c*d
^2*f*g*n^2 - c^2*d*g^2*n^2 - 3*d^3*f^2*n*log(e))*a*b^2)*B^2*log(b*x + a) + (B^2*b^3*d^3*g^2*x^3 + 3*B^2*b^3*d^
3*f*g*x^2 + 3*B^2*b^3*d^3*f^2*x)*log((b*x + a)^n)^2 + (B^2*b^3*d^3*g^2*x^3 + 3*B^2*b^3*d^3*f*g*x^2 + 3*B^2*b^3
*d^3*f^2*x)*log((d*x + c)^n)^2 + (2*B^2*b^3*d^3*g^2*x^3*log(e) - 2*(3*c*d^2*f^2*n - 3*c^2*d*f*g*n + c^3*g^2*n)
*B^2*b^3*log(d*x + c) + (a*b^2*d^3*g^2*n - (c*d^2*g^2*n - 6*d^3*f*g*log(e))*b^3)*B^2*x^2 + 2*(3*a*b^2*d^3*f*g*
n - a^2*b*d^3*g^2*n - (3*c*d^2*f*g*n - c^2*d*g^2*n - 3*d^3*f^2*log(e))*b^3)*B^2*x + 2*(3*a*b^2*d^3*f^2*n - 3*a
^2*b*d^3*f*g*n + a^3*d^3*g^2*n)*B^2*log(b*x + a))*log((b*x + a)^n) - (2*B^2*b^3*d^3*g^2*x^3*log(e) - 2*(3*c*d^
2*f^2*n - 3*c^2*d*f*g*n + c^3*g^2*n)*B^2*b^3*log(d*x + c) + (a*b^2*d^3*g^2*n - (c*d^2*g^2*n - 6*d^3*f*g*log(e)
)*b^3)*B^2*x^2 + 2*(3*a*b^2*d^3*f*g*n - a^2*b*d^3*g^2*n - (3*c*d^2*f*g*n - c^2*d*g^2*n - 3*d^3*f^2*log(e))*b^3
)*B^2*x + 2*(3*a*b^2*d^3*f^2*n - 3*a^2*b*d^3*f*g*n + a^3*d^3*g^2*n)*B^2*log(b*x + a) + 2*(B^2*b^3*d^3*g^2*x^3
+ 3*B^2*b^3*d^3*f*g*x^2 + 3*B^2*b^3*d^3*f^2*x)*log((b*x + a)^n))*log((d*x + c)^n))/(b^3*d^3)

Giac [F]

\[ \int (f+g x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=\int { {\left (g x + f\right )}^{2} {\left (B \log \left (e \left (\frac {b x + a}{d x + c}\right )^{n}\right ) + A\right )}^{2} \,d x } \]

[In]

integrate((g*x+f)^2*(A+B*log(e*((b*x+a)/(d*x+c))^n))^2,x, algorithm="giac")

[Out]

integrate((g*x + f)^2*(B*log(e*((b*x + a)/(d*x + c))^n) + A)^2, x)

Mupad [F(-1)]

Timed out. \[ \int (f+g x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=\int {\left (f+g\,x\right )}^2\,{\left (A+B\,\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )\right )}^2 \,d x \]

[In]

int((f + g*x)^2*(A + B*log(e*((a + b*x)/(c + d*x))^n))^2,x)

[Out]

int((f + g*x)^2*(A + B*log(e*((a + b*x)/(c + d*x))^n))^2, x)